package service.impl;

import dao.DeptDao;
import dao.impl.DeptDaoImpl;
import entity.Dept;
import service.DeptService;

import java.util.List;

public class DeptServiceImpl implements DeptService {
   private DeptDao dao=new DeptDaoImpl();
    @Override
    public List<Dept> getDeptList() throws Exception {
        List<Dept> list= dao.GetDeptList();
        return list;
    }

    @Override
    public int updeteDept(Dept dept) throws Exception {
       int i=dao.UpdeteDept(dept);
       if (i>0){
           System.out.println("更改成功！");
       }else {
           System.out.println("更改失败！");
       }
        return 0;
    }

    @Override
    public void getSelectDept(int deptno) throws Exception{
        dao.GetSelectDept(deptno);
    }
}
